﻿import QtQuick 2.15
import QtQuick.Controls 2.15
import QtGraphicalEffects 1.15

Item {
    width:screenWidth
    height: screenHeight

    Item{
        id:backGround
        anchors.fill: parent
    }

    Rectangle{
        anchors.top: backGround.top
        anchors.topMargin: 200
        anchors.left: backGround.left
        anchors.leftMargin: 10
        color: "#0b49b0"
        border.width: 1
        border.color: "#008edd"
        width: 1060
        height: 550

        Rectangle{
            anchors.top: parent.top
            anchors.left: parent.left
            anchors.leftMargin: 20
            width: 150
            height: 40
            color: "#0b49b0"

            Text{
                anchors.top: parent.top
                anchors.topMargin: -10
                anchors.horizontalCenter: parent.horizontalCenter
                font.pixelSize: 40
                font.bold: true
                color: "#00d8fb"
                text:"刀  盘"
            }
        }

        Item{       // 刀盘 A相
            id:knifeA_Item
            width: 300
            height: 80
            anchors.top: parent.top
            anchors.topMargin: 50
            anchors.left: parent.left
            anchors.leftMargin: 100

            property bool flag: Cpp_Connect.knifeA

            Image {
                id: knifeA_Img
                width: 80
                height: 80
                visible: false
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                source: "qrc:/Images/SignalLight_Icon.png"
            }

            ColorOverlay{
                anchors.fill: knifeA_Img
                source: knifeA_Img
                color: knifeA_Item.flag ? "green" : "red"
                // color: "red"

                Text{
                    font.pixelSize: 20
                    anchors.centerIn: parent
                    text:"I0.0"
                }
            }

            Text{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 100
                font.pixelSize: 40
                font.bold: true
                color: "white"
                text:"刀盘A相"
            }
        }
        Item{       // 刀盘 B相
            id:knifeB_Item
            width: 300
            height: 80
            anchors.top: parent.top
            anchors.topMargin: 50
            anchors.right: parent.right
            anchors.rightMargin: 100

            property bool flag: Cpp_Connect.knifeB

            Image {
                id: knifeB_Img
                width: 80
                height: 80
                visible: false
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                source: "qrc:/Images/SignalLight_Icon.png"
            }

            ColorOverlay{
                anchors.fill: knifeB_Img
                source: knifeB_Img
                color: knifeB_Item.flag ? "green" : "red"
                // color: "red"

                Text{
                    font.pixelSize: 20
                    anchors.centerIn: parent
                    text:"I0.1"
                }
            }

            Text{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 100
                font.pixelSize: 40
                font.bold: true
                color: "white"
                text:"刀盘B相"
            }
        }
        Item{       // 刀盘 上升按钮
            id:knifeUpBtn_Item
            width: 300
            height: 80
            anchors.top: parent.top
            anchors.topMargin: 170
            anchors.left: parent.left
            anchors.leftMargin: 100

            property bool flag: Cpp_Connect.knifeUpBtn

            Image {
                id: knifeUpBtn_Img
                width: 80
                height: 80
                visible: false
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                source: "qrc:/Images/SignalLight_Icon.png"
            }

            ColorOverlay{
                anchors.fill: knifeUpBtn_Img
                source: knifeUpBtn_Img
                color: knifeUpBtn_Item.flag ? "green" : "red"
                // color: "red"

                Text{
                    font.pixelSize: 20
                    anchors.centerIn: parent
                    text:"I1.1"
                }
            }

            Text{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 100
                font.pixelSize: 40
                font.bold: true
                color: "white"
                text:"刀盘上升按钮"
            }
        }
        Item{       // 刀盘 上升信号
            id:knifeUpSig_Item
            width: 300
            height: 80
            anchors.top: parent.top
            anchors.topMargin: 170
            anchors.right: parent.right
            anchors.rightMargin: 100

            property bool flag: Cpp_Connect.knifeUpSignal

            Image {
                id: knifeUpSig_Img
                width: 80
                height: 80
                visible: false
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                source: "qrc:/Images/SignalLight_Icon.png"
            }

            ColorOverlay{
                anchors.fill: knifeUpSig_Img
                source: knifeUpSig_Img
                color: knifeUpSig_Item.flag ? "green" : "red"
                // color: "red"

                Text{
                    font.pixelSize: 20
                    anchors.centerIn: parent
                    text:"Q0.0"
                }
            }

            Text{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 100
                font.pixelSize: 40
                font.bold: true
                color: "white"
                text:"刀盘上升信号"
            }
        }
        Item{       // 刀盘 下降按钮
            id:knifeDownBtn_Item
            width: 300
            height: 80
            anchors.top: parent.top
            anchors.topMargin: 290
            anchors.left: parent.left
            anchors.leftMargin: 100

            property bool flag: Cpp_Connect.knifeDownBtn

            Image {
                id: knifeDownBtn_Img
                width: 80
                height: 80
                visible: false
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                source: "qrc:/Images/SignalLight_Icon.png"
            }

            ColorOverlay{
                anchors.fill: knifeDownBtn_Img
                source: knifeDownBtn_Img
                color: knifeDownBtn_Item.flag ? "green" : "red"
                // color: "red"

                Text{
                    font.pixelSize: 20
                    anchors.centerIn: parent
                    text:"I1.2"
                }
            }

            Text{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 100
                font.pixelSize: 40
                font.bold: true
                color: "white"
                text:"刀盘下降按钮"
            }
        }
        Item{       // 刀盘 下降信号
            id:knifeDownSig_Item
            width: 300
            height: 80
            anchors.top: parent.top
            anchors.topMargin: 290
            anchors.right: parent.right
            anchors.rightMargin: 100

            property bool flag: Cpp_Connect.knifeDownSignal

            Image {
                id: knifeDownSig_Img
                width: 80
                height: 80
                visible: false
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                source: "qrc:/Images/SignalLight_Icon.png"
            }

            ColorOverlay{
                anchors.fill: knifeDownSig_Img
                source: knifeDownSig_Img
                color: knifeDownSig_Item.flag ? "green" : "red"
                // color: "red"

                Text{
                    font.pixelSize: 20
                    anchors.centerIn: parent
                    text:"Q0.1"
                }
            }

            Text{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 100
                font.pixelSize: 40
                font.bold: true
                color: "white"
                text:"刀盘下降信号"
            }
        }
        Item{       // 刀盘 上限位
            id:knifeUpLmt_Item
            width: 300
            height: 80
            anchors.top: parent.top
            anchors.topMargin: 410
            anchors.left: parent.left
            anchors.leftMargin: 100

            property bool flag: Cpp_Connect.knifeUpLmt

            Image {
                id: knifeUpLmt_Img
                width: 80
                height: 80
                visible: false
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                source: "qrc:/Images/SignalLight_Icon.png"
            }

            ColorOverlay{
                anchors.fill: knifeUpLmt_Img
                source: knifeUpLmt_Img
                color: knifeUpLmt_Item.flag ? "green" : "red"
                // color: "red"

                Text{
                    font.pixelSize: 20
                    anchors.centerIn: parent
                    text:"I0.6"
                }
            }

            Text{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 100
                font.pixelSize: 40
                font.bold: true
                color: "white"
                text:"刀盘上限位"
            }
        }
        Item{       // 刀盘 下限位
            id:knifeDownLmt_Item
            width: 300
            height: 80
            anchors.top: parent.top
            anchors.topMargin: 410
            anchors.right: parent.right
            anchors.rightMargin: 100

            property bool flag: Cpp_Connect.knifeDownLmt

            Image {
                id: knifeDownLmt_Img
                width: 80
                height: 80
                visible: false
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                source: "qrc:/Images/SignalLight_Icon.png"
            }

            ColorOverlay{
                anchors.fill: knifeDownLmt_Img
                source: knifeDownLmt_Img
                color: knifeDownLmt_Item.flag ? "green" : "red"
                // color: "red"

                Text{
                    font.pixelSize: 20
                    anchors.centerIn: parent
                    text:"Q0.7"
                }
            }

            Text{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 100
                font.pixelSize: 40
                font.bold: true
                color: "white"
                text:"刀盘下限位"
            }
        }



    }

    Rectangle{
        anchors.top: backGround.top
        anchors.topMargin: 780
        anchors.left: backGround.left
        anchors.leftMargin: 10
        color: "#0b49b0"
        border.width: 1
        border.color: "#008edd"
        width: 1060
        height: 550

        Rectangle{
            anchors.top: parent.top
            anchors.left: parent.left
            anchors.leftMargin: 20
            width: 150
            height: 40
            color: "#0b49b0"

            Text{
                anchors.top: parent.top
                anchors.topMargin: -10
                anchors.horizontalCenter: parent.horizontalCenter
                font.pixelSize: 40
                font.bold: true
                color: "#00d8fb"
                text:"胶  辊"
            }
        }

        Item{       // 胶辊 A相
            id:rollerA_Item
            width: 300
            height: 80
            anchors.top: parent.top
            anchors.topMargin: 50
            anchors.left: parent.left
            anchors.leftMargin: 100

            property bool flag: Cpp_Connect.rollerA

            Image {
                id: rollerA_Img
                width: 80
                height: 80
                visible: false
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                source: "qrc:/Images/SignalLight_Icon.png"
            }

            ColorOverlay{
                anchors.fill: rollerA_Img
                source: rollerA_Img
                color: rollerA_Item.flag ? "green" : "red"
                // color: "red"

                Text{
                    font.pixelSize: 20
                    anchors.centerIn: parent
                    text:"I0.2"
                }
            }

            Text{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 100
                font.pixelSize: 40
                font.bold: true
                color: "white"
                text:"胶辊A相"
            }
        }
        Item{       // 胶辊 B相
            id:rollerB_Item
            width: 300
            height: 80
            anchors.top: parent.top
            anchors.topMargin: 50
            anchors.right: parent.right
            anchors.rightMargin: 100

            property bool flag: Cpp_Connect.rollerB

            Image {
                id: rollerB_Img
                width: 80
                height: 80
                visible: false
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                source: "qrc:/Images/SignalLight_Icon.png"
            }

            ColorOverlay{
                anchors.fill: rollerB_Img
                source: rollerB_Img
                color: rollerB_Item.flag ? "green" : "red"
                // color: "red"

                Text{
                    font.pixelSize: 20
                    anchors.centerIn: parent
                    text:"I0.3"
                }
            }

            Text{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 100
                font.pixelSize: 40
                font.bold: true
                color: "white"
                text:"胶辊B相"
            }
        }
        Item{       // 胶辊 上升按钮
            id:rollerUpBtn_Item
            width: 300
            height: 80
            anchors.top: parent.top
            anchors.topMargin: 170
            anchors.left: parent.left
            anchors.leftMargin: 100

            property bool flag: Cpp_Connect.rollerUpBtn

            Image {
                id: rollerUpBtn_Img
                width: 80
                height: 80
                visible: false
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                source: "qrc:/Images/SignalLight_Icon.png"
            }

            ColorOverlay{
                anchors.fill: rollerUpBtn_Img
                source: rollerUpBtn_Img
                color: rollerUpBtn_Item.flag ? "green" : "red"
                // color: "red"

                Text{
                    font.pixelSize: 20
                    anchors.centerIn: parent
                    text:"I1.3"
                }
            }

            Text{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 100
                font.pixelSize: 40
                font.bold: true
                color: "white"
                text:"胶辊上升按钮"
            }
        }
        Item{       // 胶辊 上升信号
            id:rollerUpSig_Item
            width: 300
            height: 80
            anchors.top: parent.top
            anchors.topMargin: 170
            anchors.right: parent.right
            anchors.rightMargin: 100

            property bool flag: Cpp_Connect.rollerUpSignal

            Image {
                id: rollerUpSig_Img
                width: 80
                height: 80
                visible: false
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                source: "qrc:/Images/SignalLight_Icon.png"
            }

            ColorOverlay{
                anchors.fill: rollerUpSig_Img
                source: rollerUpSig_Img
                color: rollerUpSig_Item.flag ? "green" : "red"
                // color: "red"

                Text{
                    font.pixelSize: 20
                    anchors.centerIn: parent
                    text:"Q0.2"
                }
            }

            Text{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 100
                font.pixelSize: 40
                font.bold: true
                color: "white"
                text:"胶辊上升信号"
            }
        }
        Item{       // 胶辊 下降按钮
            id:rollerDownBtn_Item
            width: 300
            height: 80
            anchors.top: parent.top
            anchors.topMargin: 290
            anchors.left: parent.left
            anchors.leftMargin: 100

            property bool flag: Cpp_Connect.rollerDownBtn

            Image {
                id: rollerDownBtn_Img
                width: 80
                height: 80
                visible: false
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                source: "qrc:/Images/SignalLight_Icon.png"
            }

            ColorOverlay{
                anchors.fill: rollerDownBtn_Img
                source: rollerDownBtn_Img
                color: rollerDownBtn_Item.flag ? "green" : "red"
                // color: "red"

                Text{
                    font.pixelSize: 20
                    anchors.centerIn: parent
                    text:"I1.4"
                }
            }

            Text{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 100
                font.pixelSize: 40
                font.bold: true
                color: "white"
                text:"胶辊下降按钮"
            }
        }
        Item{       // 胶辊 下降信号
            id:rollerDownSig_Item
            width: 300
            height: 80
            anchors.top: parent.top
            anchors.topMargin: 290
            anchors.right: parent.right
            anchors.rightMargin: 100

            property bool flag: Cpp_Connect.rollerDownSignal

            Image {
                id: rollerDownSig_Img
                width: 80
                height: 80
                visible: false
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                source: "qrc:/Images/SignalLight_Icon.png"
            }

            ColorOverlay{
                anchors.fill: rollerDownSig_Img
                source: rollerDownSig_Img
                color: rollerDownSig_Item.flag ? "green" : "red"
                // color: "red"

                Text{
                    font.pixelSize: 20
                    anchors.centerIn: parent
                    text:"Q0.3"
                }
            }

            Text{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 100
                font.pixelSize: 40
                font.bold: true
                color: "white"
                text:"胶辊下降信号"
            }
        }
        Item{       // 胶辊 原点
            id:rollerOrigin_Item
            width: 300
            height: 80
            anchors.top: parent.top
            anchors.topMargin: 410
            anchors.left: parent.left
            anchors.leftMargin: 100

            property bool flag: Cpp_Connect.rollerOrigin

            Image {
                id: rollerOrigin_Img
                width: 80
                height: 80
                visible: false
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                source: "qrc:/Images/SignalLight_Icon.png"
            }

            ColorOverlay{
                anchors.fill: rollerOrigin_Img
                source: rollerOrigin_Img
                color: rollerOrigin_Item.flag ? "green" : "red"
                // color: "red"

                Text{
                    font.pixelSize: 20
                    anchors.centerIn: parent
                    text:"Q0.5"
                }
            }

            Text{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 100
                font.pixelSize: 40
                font.bold: true
                color: "white"
                text:"胶辊原点"
            }
        }



    }
    Rectangle{
        anchors.top: backGround.top
        anchors.topMargin: 1360
        anchors.left: backGround.left
        anchors.leftMargin: 10
        color: "#0b49b0"
        border.width: 1
        border.color: "#008edd"
        width: 1060
        height: 300

        Rectangle{
            anchors.top: parent.top
            anchors.left: parent.left
            anchors.leftMargin: 20
            width: 150
            height: 40
            color: "#0b49b0"

            Text{
                anchors.top: parent.top
                anchors.topMargin: -10
                anchors.horizontalCenter: parent.horizontalCenter
                font.pixelSize: 40
                font.bold: true
                color: "#00d8fb"
                text:"其  他"
            }
        }

        Item{       // 急停开关
            id:scramBtn_Item
            width: 300
            height: 80
            anchors.top: parent.top
            anchors.topMargin: 50
            anchors.left: parent.left
            anchors.leftMargin: 100

            property bool flag: Cpp_Connect.scramBtn

            Image {
                id: scramBtn_Img
                width: 80
                height: 80
                visible: false
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                source: "qrc:/Images/SignalLight_Icon.png"
            }

            ColorOverlay{
                anchors.fill: scramBtn_Img
                source: scramBtn_Img
                color: scramBtn_Item.flag ? "green" : "red"
                // color: "red"

                Text{
                    font.pixelSize: 20
                    anchors.centerIn: parent
                    text:"I0.4"
                }
            }

            Text{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 100
                font.pixelSize: 40
                font.bold: true
                color: "white"
                text:"急停开关"
            }
        }
        Item{       // 运行指示
            id:runningSig_Item
            width: 300
            height: 80
            anchors.top: parent.top
            anchors.topMargin: 50
            anchors.right: parent.right
            anchors.rightMargin: 100

            property bool flag: Cpp_Connect.runningSignal

            Image {
                id: runningSig_Img
                width: 80
                height: 80
                visible: false
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                source: "qrc:/Images/SignalLight_Icon.png"
            }

            ColorOverlay{
                anchors.fill: runningSig_Img
                source: runningSig_Img
                color: runningSig_Item.flag ? "green" : "red"
                // color: "red"

                Text{
                    font.pixelSize: 20
                    anchors.centerIn: parent
                    text:"Q0.5"
                }
            }

            Text{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 100
                font.pixelSize: 40
                font.bold: true
                color: "white"
                text:"运行指示"
            }
        }

        Item{       // 手动控制信号切断  (V2.03版本已禁用  2025.01.19)
            id:manualCutSig_Item
            width: 300
            height: 80
            anchors.top: parent.top
            anchors.topMargin: 170
            anchors.left: parent.left
            anchors.leftMargin: 100
            visible: false

            property bool flag: Cpp_Connect.manualControlSignal

            Image {
                id: manualCutSig_Img
                width: 80
                height: 80
                visible: false
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                source: "qrc:/Images/SignalLight_Icon.png"
            }

            ColorOverlay{
                anchors.fill: manualCutSig_Img
                source: manualCutSig_Img
                color: manualCutSig_Item.flag ? "green" : "red"
                // color: "red"

                Text{
                    font.pixelSize: 20
                    anchors.centerIn: parent
                    text:"Q0.4"
                }
            }

            Text{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 100
                font.pixelSize: 40
                font.bold: true
                color: "white"
                text:"手动控制信号切断"
            }
        }
        Item{       // 变频器报警
            id:transducerSig_Item
            width: 300
            height: 80
            anchors.top: parent.top
            anchors.topMargin: 170
            anchors.right: parent.right
            anchors.rightMargin: 100

            property bool flag: Cpp_Connect.transducerWarnning

            Image {
                id: transducerSig_Img
                width: 80
                height: 80
                visible: false
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                source: "qrc:/Images/SignalLight_Icon.png"
            }

            ColorOverlay{
                anchors.fill: transducerSig_Img
                source: transducerSig_Img
                color: transducerSig_Item.flag ? "green" : "red"
                // color: "red"

                Text{
                    font.pixelSize: 20
                    anchors.centerIn: parent
                    text:"I1.0"
                }
            }

            Text{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 100
                font.pixelSize: 40
                font.bold: true
                color: "white"
                text:"变频器报警"
            }
        }

        Item{       // 报警指示
            id:warningSig_Item
            width: 300
            height: 80
            // anchors.top: parent.top
            // anchors.topMargin: 290
            // anchors.left: parent.left
            // anchors.leftMargin: 100
            anchors.top: parent.top
            anchors.topMargin: 170
            anchors.left: parent.left
            anchors.leftMargin: 100

            property bool flag: Cpp_Connect.warnningSignal

            Image {
                id: warningSig_Img
                width: 80
                height: 80
                visible: false
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                source: "qrc:/Images/SignalLight_Icon.png"
            }

            ColorOverlay{
                anchors.fill: warningSig_Img
                source: warningSig_Img
                color: warningSig_Item.flag ? "green" : "red"
                // color: "red"

                Text{
                    font.pixelSize: 20
                    anchors.centerIn: parent
                    text:"Q0.6"
                }
            }

            Text{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 100
                font.pixelSize: 40
                font.bold: true
                color: "white"
                text:"报警指示"
            }
        }

    }

}
